﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gama.Contract
{
    public interface ISecurityService
    {
        /// <summary>
        /// Authenticates user credential.
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="password">User password</param>
        /// <returns>true if authenticated; false otherwise</returns>
//        IUserPrincipal Authenticate(string userId, string password);

        /// <summary>
        /// Creates new user.
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="password">User password</param>
        /// <returns>Created security principal</returns>
//        IUserPrincipal CreateUser(string userId, string password);

        /// <summary>
        /// Adds roles to user.
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="roles">Roles to add</param>
       

        /// <summary>
        /// Authenticates admin credential.
        /// </summary>
        /// <param name="id">User Id</param>
        /// <param name="password">User password</param>
        /// <returns>true if authenticated; false otherwise</returns>
        //IUserPrincipal AuthenticateStaff(string id, string password);

        //IUserPrincipal GetStaffPrincipal(string id);

        /// <summary>
        /// Verifies if there exists a guest associated with the given Id
        /// </summary>
        /// <param name="id">Guest Id</param>
        /// <returns>true if guest Id exists; otherwise, false</returns>
        

        /// <summary>
        /// Creates new guest and returns guest Id
        /// </summary>
        /// <returns>Guest Id</returns>
       

        /// <summary>
        /// Compute a random number (salt).
        /// Add the random number to the password string.
        /// Compute the hash, or encrypt the resulting string.
        /// Store both the hash/encryption output and the random number in the password store.
        /// </summary>
        /// <param name="password"></param>
        /// <returns></returns>
        string Encrypt(string password);

        string GenerateRandomString(int length, CharSets charSet);

        bool ComparePassword(string password, string dbPassword);
        
    }

    public enum CharSets
    {
        Letters,
        Numerics,
        Alphanumeric
    }
}
